package com.bafa.front.presentationbeans;

import java.util.List;
import java.util.TreeSet;

import com.bafa.objects.Match;
import com.bafa.services.RetrieveServices;

public class TeamMatchListBean {

	private TreeSet matches = new TreeSet();

	/**
	 * Used to display list of top scorers for a division for a season
	 * @param scorers
	 * @param seasonId
	 * @param divisionId
	 */
	public TeamMatchListBean(Match[] matches,int teamId) {
		for(int i=0;i<matches.length;i++){
			this.matches.add(new TeamMatchBean(matches[i],teamId));
		}
	}
	
	public TeamMatchListBean(List matches,int teamId) {
		
		for(int i=0;i<matches.size();i++){
			this.matches.add(new TeamMatchBean(RetrieveServices.getMatch((Integer)matches.get(i)),teamId));
		}
	}
	
	public TeamMatchBean[] matches(){
		return (TeamMatchBean[])matches.toArray(new TeamMatchBean[matches.size()]);
	}
	public TreeSet getMatches() {
		return matches;
	}

	public void setMatches(TreeSet players) {
		this.matches = players;
	}
	
}
